/*
 * QMainWindowAdapter.cpp  0.4.0 / Nov 30, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
#include "QMainWindowAdapter.h"

// QMainWindowAdapter :: Public Constructor. -----------------------------------

/*!
 * \brief Constructs new QMainWindowAdapter object.
 *
 * \param parent the parent widget
 * \param flags the window flags
 */
QMainWindowAdapter::QMainWindowAdapter(QWidget *parent,
                                       Qt::WindowFlags flags)
  : QMainWindow(parent, flags)
{
  // empty constructor body
}

// QMainWindowAdapter :: Overridden Member Functions. --------------------------

/*!
 * \inheritDoc
 */
QSize QMainWindowAdapter::sizeHint() const
{
  QSize sh = QMainWindow::sizeHint();
  QMenuBar *mb = menuBar();
  if (mb && !testAttribute(Qt::WA_WState_ExplicitShowHide)) {
    sh.setHeight(sh.height() + menuBar()->sizeHint().height() +
                 style()->styleHint(QStyle::SH_MainWindow_SpaceBelowMenuBar, 0,
                                    this));
  }
  return sh;
}

/*!
 * \inheritDoc
 */
QMenu *QMainWindowAdapter::createPopupMenu()
{
  return 0;
}
